/* 
 * File:   OperateurMap.h
 * Author: Gab'z
 *
 * Created on 8 mai 2012, 02:04
 */

#ifndef OPERATEURMAP_H
#define	OPERATEURMAP_H

#include <map>
#include <string>
#include "Operateur.h"
#include "UserCommand.h"

class OperateurMap {
    static OperateurMap* instance;
    std::map<const std::string, Operateur*> _operateurMap;
    std::map<const std::string, UserCommand*> _userCommandMap;
public:

    static OperateurMap* getInstance() {
        if (instance == 0) {
            instance = new OperateurMap();
        }
        return instance;
    }

    static void deleteInstance() {
        if (instance != 0) delete instance;
    }

    void addReplaceUserCommand(UserCommand* uc);
    void removeOperateur(const std::string& str);
    bool isOperateurName(const std::string& str) const;
    Operateur* getOperateur(const std::string& str) const throw (OperatorException);
private:

    OperateurMap() ;

    // OperateurMap(const OperateurMap& orig);

    virtual ~OperateurMap();
};

#endif	/* OPERATEURMAP_H */

